package com.aspyn.tabtest;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TabHost;

public class TabTestActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        TabHost th = (TabHost)findViewById(R.id.tabHost);
        th.setup();
        
        int[] tabIDS = {R.id.tab1,R.id.tab2,R.id.tab3, R.id.tab4};
        
        TabHost.TabSpec[] specs = new TabHost.TabSpec[4];
        
        DrawView dv = new DrawView(this);
        
        for (int i = 0;	i < 4; i++) {
        	if (i == 0) {
        		LinearLayout layout1 = (LinearLayout)findViewById(tabIDS[i]);
        		layout1.addView(dv);
        	}
        	specs[i] = th.newTabSpec("Tag" + Integer.toString(i));
        	specs[i].setContent(tabIDS[i]);
        	
        	specs[i].setIndicator("Tab " + Integer.toString(i));
        	th.addTab(specs[i]);
        }
        
    }
}